<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <link rel="stylesheet" type="text/css" href="<html:rewrite page='/protected/style/style.css'/>" id="styleFile"/>
        <link rel="stylesheet" type="text/css" href="<html:rewrite page='/protected/script/ext-1.1.1/resources/css/ext-all.css'/>" />

        <script src="<html:rewrite page='/protected/script/ext-1.1.1/adapter/ext/ext-base.js'/>" type="text/javascript"></script>
        <script src="<html:rewrite page='/protected/script/ext-1.1.1/ext-all.js'/>" type="text/javascript"></script>

        <script type="text/javascript">
            // create the stackTraceShow application (single instance)
            var stackTraceShow = function(){
                // define some private variables
                var dialog, showBtn;
                
                // return a public interface
                return {
                    init : function(){
                         showBtn = Ext.get('show-dialog-btn');
                         // attach to click event
                         showBtn.on('click', this.showDialog, this);
                    },
                   
                    showDialog : function(){
                        if(!dialog){ // lazy initialize the dialog and only create it once
                            dialog = new Ext.BasicDialog("stackTrace-dlg", { 
                                    autoTabs:true,
                                    width:500,
                                    height:300,
                                    shadow:true,
                                    minWidth:300,
                                    minHeight:250,
                                    proxyDrag: true
                            });
                            dialog.addKeyListener(27, dialog.hide, dialog);
                            dialog.addButton('Submit', dialog.hide, dialog).disable();
                            dialog.addButton('Close', dialog.hide, dialog);
                        }
                        dialog.show(showBtn.dom);
                    }
                };
            }();
            
            // using onDocumentReady instead of window.onload initializes the application
            // when the DOM is ready, without waiting for images and other resources to load
            Ext.onReady(stackTraceShow.init, stackTraceShow, true);
            
        </script>

        <title>. : Posgrado : .</title>
    </head>
    
    <body>
        <div id="wrap">
            <%-- Header tile --%>
            <div id="header">
                <h1>Posgrado FIUBA</h1>
            </div>

            <div class="middle">
                <span style="color: red; vertical-align: middle;">Un error ha ocurrido.</span>
                
                <logic:present name="exceptionMessage">
                    <p>
                        ${exceptionMessage}
                    </p>
                </logic:present>

                <logic:present name="exceptionStackTrace">
                    <p>
                        <img src="<html:rewrite page='/protected/img/info.png'/>" id="show-dialog-btn" class="allButtons" title="Muestra informacion del error ...">
                        <div id="clear"></div>
                    </p>

                    <!-- The dialog is created from existing markup.
                         The inline styles just hide it until it created and should be in a stylesheet -->
                    <div id="stackTrace-dlg" style="visibility:hidden;position:absolute;top:0px;">
                        <div class="x-dlg-hd">
                            Stack Trace
                        </div>
                        <div class="x-dlg-bd">
                        <!-- Auto create tab 1 -->
                            <div class="x-dlg-tab" title="Stack trace de la excepcion">
                                <!-- Nested "inner-tab" to safely add padding -->
                                <div class="inner-tab">
                                     ${exceptionStackTrace}
                                </div>
                            </div>
                        </div>
                    </div>

                </logic:present>

            </div>
       
            <div class="right">
                <ul>
                    <li>
                        <html:link action="/protected/main.do">Men&uacute; principal</html:link>
                    </li>    
                </ul>
            </div>
        
            <div id="clear"></div>
        </div>

        <div id="footer">
        </div>
    </body>
    
</html>